package com.jf.cloud.service.sysmanager.common.util;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.servlet.http.HttpServletRequest;

public class DomainUtil {
	
	static Log log = LogFactory.getLog(DomainUtil.class);
	
	 /**
	   * µÃµ½ÓòÃû http://www.nalancn.com:90/
	   * @param request HttpServletRequest
	   */
	  public static String getDomainStr(HttpServletRequest request){
		    String url = "";
			String port = "";
			if (80!=request.getServerPort()) {
				port = ":" + request.getServerPort();
			}
			url = "http://" + request.getServerName() + port+ request.getContextPath() ;
	    return url;
	  }
}
